package com.example.demo03_mvm.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.demo03_mvm.databinding.ItemGoodsBinding;
import com.example.demo03_mvm.databinding.ItemXhBinding;
import com.example.demo03_mvm.model.GoodsTypeEntity;

import java.util.List;

public class XHAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public XHAdapter(int layoutResId, @Nullable List<String> data) {
        super(layoutResId, data);
    }

    @Override
    public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {

        DataBindingUtil.bind(holder.itemView);
        super.onBindViewHolder(holder, position);

    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, String str) {
        ItemXhBinding binding=(ItemXhBinding) DataBindingUtil.getBinding(baseViewHolder.itemView);
        binding.setXh(str);
    }
}
